<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    
</body>
<script>
    function Student(name,age,gender,id){
        this.name = name;
        this.age = age;
        this.gender = gender;
        this.id = id;
    }
    // 輸出原型對象
    // console.log(Student.prototype)
    // console.log(Student);
    // console.dir(Student);
    Student.prototype.sayHi = function(){
        console.log('你们好，我叫'+ this.name + ',今年' + this.age +'歲,我是一个' + this.gender +'孩子');
    }
    let s1 = new Student('LIER',18,'男',9);
    s1.sayHi();
    let s2 = new Student();
    s2.name = 'HADES';
    s2.age = 18;
    s2.gender = '男';
    s2.id = 10;
    s2.sayHi();
    console.log(s1.sayHi === s2.sayHi)
</script>
</html>